<template>
	<view class="my-pay-box">
	<!-- 全选 -->
	<label class="radio" @click="changeAll">
		<radio color="#c00000" :checked="ifFullChkeck" /><text>全选</text>
	</label>
	
	<!-- 合计 -->
	<view class="sum">
		合计：<text class="amount">￥{{checkedGoodsAmount}}</text>
		
	</view>
	
	<!-- 结算按钮 -->
	<view class="btn-pay">
	<text>结算:({{checkedCount}})</text>	
	</view>
	</view>
</template>

<script>
import {mapGetters,mapMutations}from 'vuex'
	export default {
		name:"my-pay",
		data() {
			return {
				
			};
		},
		computed:{
			...mapGetters('m_cart',['checkedCount','total','checkedGoodsAmount']),
			ifFullChkeck(){
return this.total === this.checkedCount
			}
		},
		methods:{
			...mapMutations('m_cart',['updateAllGoodsState']),
			changeAll(){
				this.updateAllGoodsState(!this.ifFullChkeck)
			}
		}
	}
</script>

<style lang="scss">
.my-pay-box {
	
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 50px;
	background-color: white;
	font-size: 14px;
	padding-left: 5px;
	.radio{
		display: flex;
		align-items: center;
	}
	.sum{
		
		
		.amount{
			color: #C00000;
			font-weight: bold;
		}
	}
	.btn-pay{
		height: 50px;
	
		background-color: #c00000;
		display: flex;
		justify-content: center;
		align-items: center;
		color: white;
		padding: 0 10px;
		min-width: 100px;

	}
}
</style>
